home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / sptdemo.zip / UTIL.PRG < prev   
Text File  |  1995-02-28  |  2KB  |  59 lines

  1. // ----------------------------------------------------------------------------
  2. // (c) 1,994 Juan Miguel Sosso Prieto - Todos los derechos reservados
  3. // Autor...: Juan Miguel Sosso
  4. // Proyecto: Contabilidad Personal
  5. // Módulo..: Utilidades
  6. // Fecha...: Mon  16-05-94
  7. // Hora....: 12:52:51
  8.  
  9. #include "sptools.ch"
  10.  
  11. // ----------------------------------------------------------------------------
  12.  
  13. //function cClrMnu()
  14. //return "W+/BG, W+/N, GR+/BG, GR+/N, W/BG, W/N, N/BG"
  15.  
  16. // ----------------------------------------------------------------------------
  17.  
  18. //function cClrBrw()
  19. //return "BG+/B,N/BG,W+/B,N*/W"
  20.  
  21. // ---------------------------------------------------------------------------
  22.  
  23. //function cClrWnd()
  24. //return "W+/W,N*/W,N/W,BG+/B,W+/G,N/BG"
  25.  
  26. // ----------------------------------------------------------------------------
  27.  
  28. proc Reorganizar()
  29.  
  30.    local nIng := 0
  31.    local nGas := 0
  32.  
  33.    if nMsgBox( "Esta operación pueder ser larga,;pero es conveniente realizarla;al menos una vez al mes.", ;
  34.                { "  &Empezar  ", "  &Cancelar  " } ) == 1
  35.       REINDEX DATABASES PACK
  36.  
  37.       Grupo->( DbEval( { || Grupo->nINGRESO := 0, Grupo->nGASTO := 0 } ) )
  38.  
  39.       Apunte->( DbGoTop() )
  40.       while ! Apunte->( EoF() )
  41.          nIng += Apunte->nINGRESO
  42.          nGas += Apunte->nGASTO
  43.  
  44.          if Grupo->( DbSeek( Apunte->nGRUPO, .f. ) )
  45.             Grupo->nINGRESO += Apunte->nINGRESO
  46.             Grupo->nGASTO   += Apunte->nGASTO
  47.          endif
  48.  
  49.          Apunte->( DbSkip() )
  50.       enddo
  51.  
  52.       Config->nINGRESO = nIng
  53.       Config->nGASTO   = nGas
  54.    endif
  55.  
  56. return
  57.  
  58. // ----------------------------------------------------------------------------
  59.